<template>
    <div class='box'>
      <!-- 顶部搜索框 -->
      <div class="top">
        <van-icon class="left" name="arrow-left" @click="goHome"/>
        <div class="search">
          <b class="title">
              <van-icon name="search" />
          </b>
          <input type="text" v-model="keywords" placeholder="全场50元起步">
        </div>
        <div class="right"></div>
      </div>
    </div>
</template>

<script>
import { ref, reactive } from "vue";
// 引入api
import api from "../http/api.js";
// 引入vuex
import { useStore } from "vuex";
export default {
  setup(props) {
    const store = useStore();
    // 返回首页
    const goHome = () => {
      store.commit("setTab", { act: 0, isShow: true });
      location.href = "/#/home";
    };
    return {
      store,
      goHome
    };
  }
};
</script>

<style scoped lang='scss'>
.box {
  width: 100%;
  .top {
    width: 100%;
    height: 100px;
    position: fixed;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 15px;
    border-bottom: 1px solid #ddd;
    b {
      font-weight: 700;
      font-size: 40px;
    }
    .search {
      width: 80%;
      box-sizing: border-box;
      padding: 15px 0;
      height: 70px;
      background: #f7f7f7;
      display: flex;
      border-radius: 40px;
      .title {
        width: 60px;
        padding: 0 20px;
        box-sizing: border-box;
      }
      input {
        background: none;
        border: none;
      }
    }
  }
}
</style>
